]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
remote-search: implement new ActivateResult() method
authorCosimo Cecchi <cosimoc@gnome.org>
Wed, 5 Dec 2012 16:48:22 +0000 (11:48 -0500)
committerCosimo Cecchi <cosimoc@gnome.org>
Thu, 6 Dec 2012 17:15:13 +0000 (12:15 -0500)
This allows us to fix the shortcomings of the original ActivateResult()
method. In particular:
- allow to pass the search terms to the provider
- allow to pass a user interaction timestamp

https://bugzilla.gnome.org/show_bug.cgi?id=689735

js/ui/remoteSearch.js
js/ui/searchDisplay.js

index 5e9ee89eaffbb754d36901690a0a4e56f237da09..3bdba7d863f77d2b96ac403b5f46e387a2103715 100644 (file)
@@ -285,8 +285,8 @@ const RemoteSearchProvider2 = new Lang.Class({
         this.canLaunchSearch = true;
     },
 
-    activateResult: function(id) {
-        this.proxy.ActivateResultRemote(id, [], 0);
+    activateResult: function(id, terms) {
+        this.proxy.ActivateResultRemote(id, terms, global.get_current_time());
     },
 
     launchSearch: function(terms) {
index 7d81594d1992dc3ec61c3b253d3610effe8aa186..869586b9f42d085d0cf739854a99db375e39b7ca 100644 (file)
@@ -22,6 +22,7 @@ const SearchResult = new Lang.Class({
     _init: function(provider, metaInfo, terms) {
         this.provider = provider;
         this.metaInfo = metaInfo;
+        this.terms = terms;
         this.actor = new St.Button({ style_class: 'search-result',
                                      reactive: true,
                                      x_align: St.Align.START,
@@ -73,7 +74,7 @@ const SearchResult = new Lang.Class({
     },
 
     activate: function() {
-        this.provider.activateResult(this.metaInfo.id);
+        this.provider.activateResult(this.metaInfo.id, this.terms);
         Main.overview.toggle();
     },
 
@@ -96,7 +97,7 @@ const SearchResult = new Lang.Class({
         if (this.provider.dragActivateResult)
             this.provider.dragActivateResult(this.metaInfo.id, params);
         else
-            this.provider.activateResult(this.metaInfo.id);
+            this.provider.activateResult(this.metaInfo.id, this.terms);
     }
 });